#!/bin/bash

# extract images from covers
python3 /usr/bin/getcovers.py -x /data/library/music && curl -X POST http://127.0.0.1/mpd/update/covers

# If we're allowed to use external metadata, retrieve covers and artist pictures
EXTERNALMD=`cat /etc/audiocontrol2.conf | grep external_metadata | awk -F= '{print $2}' | grep 1`
if [ "$EXTERNALMD" != "" ]; then
 echo "Looking up images ..."
 /usr/bin/getalbums.py -x -c -a /data/library/music  && curl -X POST http://127.0.0.1/mpd/update/covers
fi

